<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        if(!Schema::hasTable('categorys')) {
            Schema::create('categorys', function (Blueprint $table) {
                $table->engine = 'InnoDB';
                $table->increments('id');
                $table->timestamps();
                $table->string('name', 255);
                $table->string('label', 255);
                $table->string('description', 255);
                $table->integer('cid');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('categorys');
    }
}
